PATCH 2/2] super-intel: enable loading metadata from non-IMSMcompliant disks

From 492192b1777936ccaf745aeb73f83f55c12a5a37 Mon Sep 17 00:00:00 2001
From: Marcin Labun <marcin.labun [at] intel.com>
Date: Tue, 22 Mar 2011 17:24:35 +0100
Subject: [PATCH 2/2] super-intel: enable loading metadata from non-IMSM compliant disks

Honor ignore_hw_compat to load metadata from disk attached to non-IMSM
controller or when there are no IMSM OROM/EFI capabilities.
Used only for guessing and examining metadata format.

Signed-off-by: Marcin Labun <marcin.labun [at] intel.com>
---
super-intel.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index acd7571..8e57171 100644
--- a/super-intel.c
+++ b/super-intel.c
[at] [at] -2218,11 +2218,12 [at] [at] static int compare_super_imsm(struct supertype *st, struct supertype *tst)
* use the same Intel hba
*/
if (!check_env("IMSM_NO_PLATFORM")) {
- if (first->hba->type != sec->hba->type) {
+ if (!first->hba || !sec->hba || (first->hba->type != sec->hba->type)) {
+
fprintf(stderr,
"HBAs of devices does not match %s != %s\n",
- get_sys_dev_type(first->hba->type),
- get_sys_dev_type(sec->hba->type));
+ first->hba ? get_sys_dev_type(first->hba->type) : NULL,
+ sec->hba ? get_sys_dev_type(sec->hba->type) : NULL);
return 3;
}
}
[at] [at] -2864,7 +2865,7 [at] [at] static int find_intel_hba_capability(int fd, struct intel_super *super, char *de
{
struct sys_dev *hba_name;
int rv = 0;
-
+
if ((fd < 0) || check_env("IMSM_NO_PLATFORM")) {
super->orom = NULL;
super->hba = NULL;
[at] [at] -3386,16 +3387,19 [at] [at] static int load_super_imsm(struct supertype *st, int fd, char *devname)
sizeof(*super));
return 1;
}
+ /* Load hba and capabilities if they exist.
+ * But do not preclude loading metadata in case capabilities or hba are
+ * non-compliant and ignore_hw_compat is set.
+ */
rv = find_intel_hba_capability(fd, super, devname);
/* no orom/efi or non-intel hba of the disk */
- if (rv != 0) {
+ if ((rv != 0) && (st->ignore_hw_compat == 0)) {
if (devname)
fprintf(stderr,
Name ": No OROM/EFI properties for %s\n", devname);
free_imsm(super);
return 2;
}
-
rv = load_and_parse_mpb(fd, super, devname, 0);

if (rv) {
--
1.6.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo [at] vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Marcin.Labun [ Di, 22 März 2011 17:50 ] [ ID #2056958 ]
Linux » gmane.linux.raid » PATCH 2/2] super-intel: enable loading metadata from non-IMSMcompliant disks

Vorheriges Thema: RAID-5 and mdadm --assemble troubleshooting
Nächstes Thema: [PATCH 1/2] examine: allows to examine a disk metadata onnon-metadata compliant systems